Socket
Socket
Sign inDemoInstall

hiredis

Package Overview
Dependencies
3
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hiredis

Wrapper for reply processing code in hiredis


Version published
Weekly downloads
8.8K
decreased by-16.99%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Build Status

hiredis-node

Node extension that wraps hiredis. Because Node is already good at doing I/O, hiredis-node only provides bindings to the protocol parser. The hiredis protocol parser is faster than JavaScript protocol parsers, but the speedup only becomes noticable for large replies. If you use Redis for simple SET/GET operations, there won't be a big benefit to using hiredis. If you use Redis for big SUNION/SINTER/LRANGE/ZRANGE operations, the benefit to using hiredis-node can be significant.

Install

Install with NPM:

npm install hiredis

Usage

hiredis-node works out of the box with Matt Ranney's node_redis. The latter has an optional dependency on hiredis-node, so maybe you're already using it without knowing.

Alternatively, you can use it directly:

var hiredis = require("hiredis"),
    reader = new hiredis.Reader();

// Data comes in
reader.feed("$5\r\nhello\r\n");

// Reply comes out
reader.get() // => "hello"

Instead of returning strings for bulk payloads, it can also return buffers:

var hiredis = require("hiredis"),
    reader = new hiredis.Reader({ return_buffers: true });

// Data comes in
reader.feed("$5\r\nhello\r\n");

// Reply comes out
reader.get() // => <Buffer 68 65 6c 6c 6f>

Windows

Dmitry Gorbunov (@fuwaneko) made a fork of hiredis-node with Windows support.

License

This code is released under the BSD license, after the license of hiredis.

FAQs

Last updated on 02 Jun 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc